<?php
    include_once("SPARQL/Graphite.php");
    include_once("library/URL.php");

    if(isset($_GET['id']))
    {
        print "<h1>PROFILE ".$_GET['id']."</h1>";
        $result = strpos($_GET['id'],'_');
        if($result)
        {
            $temp = explode('_',$_GET['id']);
            if($temp[0] == 'catalog')
                $sType = 'category';
            else
                $sType = $temp[0];
            $uri = URL::getLink($sType.'/id/'.$_GET['id']);
        }
        else
        {
            $uri = URL::getLink('id/'.$_GET['id']);
        }
        
        $graph = new Graphite();
        $graph->setDebug( true );
        $graph->load($uri );
        print $graph->resource($uri)->dump();
    }
    else
    {
        print "<h1>TRANG CHU</h1>";
    }
?>